home *** CD-ROM | disk | FTP | other *** search
/ Enter 2001 April / EnterCD4.iso / Update / SQL Server SP3 / sql70sp3i.exe / X86 / BINN / res / 1033 / sqlmmc.rll / HTML / JSTSKPAD.JS < prev    next >
Encoding:
Text File  |  1999-04-12  |  23.1 KB  |  679 lines

  1. function DoNothing()
  2. {
  3.     // Stub
  4. }
  5.  
  6. //*************************************
  7. //GET DYNAMIC BODY AND WATERMARK STYLES
  8. //*************************************
  9.  
  10. function GetBodyAndWatermarkStyles()
  11. {
  12.     var szBodyBgColor;
  13.     var szWatermarkColor;
  14.     var szBrandingColor;
  15.     
  16.     // Set body and watermark depending on color depth
  17.     if (screen.colorDepth <= 8) {
  18.         szBodyBgColor = "background-color:window;\n";
  19.         szWatermarkColor = "color:#" + SysColorX.GetDerivedHex("window", "threedshadow", "CSS", 30) + ";\n";
  20.         szBrandingColor = "color:#" + SysColorX.GetDerivedHex("window", "threedshadow", "CSS", 60) + ";\n";
  21.     }
  22.     else {
  23.         szBodyBgColor = "background-color:threedhighlight;\n";
  24.         szWatermarkColor = "color:#" + SysColorX.GetDerivedHex("window", "threedshadow", "CSS", 30) + ";\n";
  25.         szBrandingColor = "color:#" + SysColorX.GetDerivedHex("window", "threedshadow", "CSS", 60) + ";\n";        
  26.     }
  27.  
  28.     
  29.     var szStyle = "<style>\n\n";
  30.  
  31.     // Body
  32.     szStyle += "Body\n";
  33.     szStyle += "  {\n";
  34.     szStyle += "  font-family:Verdana;\n";
  35.     szStyle += "  font-weight:normal;\n";
  36.     szStyle += "  cursor:default;\n";
  37.     szStyle += "  " + szBodyBgColor;
  38.     szStyle += "  }\n\n";
  39.  
  40.     // Watermark    
  41.     szStyle += ".tdWatermark\n";
  42.     szStyle += "  {\n";
  43.     szStyle += "  font-family:" + gszWatermarkFontFamilyName + ";\n";
  44.     szStyle += "  text-align:right;\n";
  45.     szStyle += "  cursor:default;\n";
  46.     szStyle += "  " + szWatermarkColor;
  47.     szStyle += "  }\n\n";
  48.  
  49.     // Branding
  50.     szStyle += ".tdBranding\n";
  51.     szStyle += "  {\n";
  52.     szStyle += "  font-family:" + gszBrandingFontFamilyName + ";\n";
  53.     szStyle += "  line-height:50%;\n";
  54.     szStyle += "  letter-spacing:-1.5pt;\n";
  55.     szStyle += "  text-align:right;\n";
  56.     szStyle += "  cursor:default;\n";
  57.     szStyle += "  " + szBrandingColor;
  58.     szStyle += "  }\n\n";
  59.  
  60.     szStyle += "</style>\n";
  61.     
  62.     return szStyle;
  63. }
  64.  
  65. //******************************
  66. // BUILD TASKPAD BUTTON FUNCTION
  67. //******************************
  68.  
  69. function BuildTaskpadButtons(iPageStyle)
  70. {
  71.     var szNextButton;
  72.  
  73.     for (var i = 0; i <= giTotalButtons; i++) {
  74.         szNextButton = GetNextButton (iPageStyle, i);
  75.           divSymbolContainer.insertAdjacentHTML ("BeforeEnd", szNextButton);
  76.     }
  77. }
  78.  
  79. //**************************
  80. // GET NEXT BUTTON FUNCTIONS
  81. //**************************
  82.  
  83. function GetNextButton(iPageStyle, theIndex)
  84. {
  85.     // Calculate the column & row placement of the button
  86.     // based on its index
  87.     var theColumn    = theIndex % giTotalColumns;                            // mod returns column
  88.     var theRow = Math.floor (theIndex / giTotalColumns);        // division returns row
  89.     
  90.     // Multiply row & column by offset base to determine relative placement
  91.     // of button in percentage terms.
  92.     switch (iPageStyle)
  93.     {
  94.         case CON_TASKPAD_STYLE_VERTICAL1:
  95.             // Vertical layout with 2 listviews
  96.             var iLeftLoc = theColumn * 52;            // columns are 52% apart in this layout
  97.             var iTopLoc = theRow * 25;                    // rows are 25% apart in this layout        
  98.             break;
  99.             
  100.         case CON_TASKPAD_STYLE_HORIZONTAL1:
  101.             // Horizontal layout with 1 listview
  102.             var iLeftLoc = theColumn * 25;            // columns are 25% apart in this layout
  103.             var iTopLoc = theRow * 52;                    // rows are 52% apart in this layout
  104.             break;
  105.             
  106.         case CON_TASKPAD_STYLE_NOLISTVIEW:
  107.             // Buttons-only layout (no listview)
  108.             var iLeftLoc = theColumn * 25;            // columns are 25% apart in this layout
  109.             var iTopLoc = theRow * 25;                    // rows are 25% apart in this layout
  110.             break;            
  111.     }
  112.     
  113.     // Get the HTML for the button
  114.     var szFormattedBtn;
  115.     szFormattedBtn = GetButtonHTML (gaiBtnObjectType[theIndex], theIndex, iLeftLoc, iTopLoc)
  116.     return szFormattedBtn;
  117. }
  118.  
  119. //*************************
  120. // GET BUTTON HTML FUNCTION
  121. //*************************
  122.  
  123. // Bill (and Rano) was here
  124. function EndHREFIfNecessary (theIndex, bWantAnchor)
  125. {
  126.     var szHREF = "";
  127.     if (gaiBtnActionType[theIndex] == 1) {
  128.         if (bWantAnchor == true)
  129.             szHREF += "</A>";
  130.     }
  131.     return szHREF;
  132. }
  133. function StartHREFIfNecessary (theIndex, bWantAnchor)
  134. {
  135.     var szHREF = "";
  136.     if (gaiBtnActionType[theIndex] == 1) {
  137.         // if it's a link, we CAN'T use script to redirect,
  138.         // because this screws up MMC's history list!!!!!!! !
  139.         if (bWantAnchor == true)
  140.             szHREF += "<A HREF=\"";
  141.         szHREF += gaszBtnActionURL[theIndex];
  142.         if (bWantAnchor == true)
  143.             szHREF += "\" STYLE=\"textdecoration\">";
  144.     }
  145.     return szHREF;
  146. }
  147. function GetButtonHTML(iBtnType, theIndex, iLeftLoc, iTopLoc)
  148. {
  149.     // Build up the HTML for the button
  150.     var szBtnHTML = "";
  151.     
  152.     switch (iBtnType)
  153.     {
  154.         case CON_TASK_DISPLAY_TYPE_SYMBOL:             // EOT-based symbol | font
  155.             szBtnHTML += "<DIV class=divSymbol id=divSymbol_" + theIndex + " style=\"LEFT: " + iLeftLoc + "%; TOP: " + iTopLoc + "%\">\n";
  156.             szBtnHTML += "<TABLE id=tblSymbol_" + theIndex + " border=0 cellPadding=0 cellSpacing=0 frame=none rules=none width=100%>\n";
  157.             szBtnHTML += "<TBODY>\n";
  158.             szBtnHTML += "<TR>\n";
  159.             szBtnHTML += "<TD align=middle class=tdSymbol id=tdSymbol_" + theIndex + " noWrap vAlign=top>";
  160.             szBtnHTML += StartHREFIfNecessary (theIndex, true);
  161.             szBtnHTML += "<SPAN class=clsSymbolBtn id=spanSymbol_" + theIndex + " ";
  162.             szBtnHTML += "style=\"COLOR: \"threedhighlight\"; FONT-FAMILY: Webdings; FONT-SIZE: 68px; FONT-WEIGHT: normal\" TaskpadButton>";
  163.             szBtnHTML += "test<!--Insert here-->";
  164.             szBtnHTML += "</SPAN>";
  165.             szBtnHTML += EndHREFIfNecessary (theIndex, true);
  166.             szBtnHTML += "</TD></TR>\n";
  167.             szBtnHTML += "<TR>\n";
  168.             szBtnHTML += "<TD align=middle class=tdSymbol id=tdSymbol_" + theIndex + " vAlign=top width=100%>";
  169.             szBtnHTML += "<A class=clsSymbolBtn href=\"";
  170.             szBtnHTML += StartHREFIfNecessary (theIndex, false);
  171.             szBtnHTML += "\" id=anchorCaption_" + theIndex + " ";
  172.             szBtnHTML += "style=\"COLOR: \"threedhighlight\"; FONT-SIZE: 18px; TEXT-DECORATION: none\" TaskpadButton>";
  173.             szBtnHTML += "<!--Insert here--></A></TD></TR></TBODY></TABLE></DIV><!--divSymbol_" + theIndex + "-->\n";
  174.             break;
  175.             
  176.         case CON_TASK_DISPLAY_TYPE_VANILLA_GIF:        // (GIF) index 0 is transparent
  177.         case CON_TASK_DISPLAY_TYPE_CHOCOLATE_GIF:      // (GIF) index 1 is transparent
  178.             // First get the Hex value of the CSS threedhighlight constant
  179.             var szMaskColor = SysColorX.HEXthreedshadow;
  180.     
  181.             szBtnHTML += "<DIV class=divSymbol id=divSymbol_" + theIndex + " style=\"LEFT: " + iLeftLoc + "%; TOP: " + iTopLoc + "%\">\n";
  182.             szBtnHTML += "<TABLE id=tblSymbol_" + theIndex + " border=0 cellPadding=0 cellSpacing=0 frame=none rules=none width=100%>\n";
  183.             szBtnHTML += "<TBODY>\n";
  184.             szBtnHTML += "<TR>\n";
  185.             szBtnHTML += "<TD align=middle class=tdSymbol id=tdSymbol_" + theIndex + " noWrap vAlign=top>";
  186.             szBtnHTML += StartHREFIfNecessary (theIndex, true);
  187.             szBtnHTML += "<IMG class=clsTaskBtn height=250 id=imgTaskBtn_" + theIndex + " src=\"\" ";
  188.             szBtnHTML += "style=\"FILTER: mask(color=" + szMaskColor + "); HEIGHT: 66px; WIDTH: 66px\" width=250 TaskpadButton>";
  189.             szBtnHTML += EndHREFIfNecessary (theIndex, true);
  190.             szBtnHTML += "</TD></TR>\n";
  191.             szBtnHTML += "<TR>\n";
  192.             szBtnHTML += "<TD align=middle class=tdSymbol id=tdAnchor_" + theIndex + " vAlign=top width=100% TaskpadButton>";
  193.             szBtnHTML += "<A class=clsSymbolBtn href=\"";
  194.             szBtnHTML += StartHREFIfNecessary (theIndex, false);
  195.             szBtnHTML += "\" id=anchorCaption_" + theIndex + " ";
  196.             szBtnHTML += "style=\"FONT-SIZE: 18px\" TaskpadButton>";
  197.             szBtnHTML += "<!--Insert Here--></A></TD></TR></TBODY></TABLE></DIV><!--divSymbol_" + theIndex + "-->\n";
  198.  
  199.             break;
  200.         
  201.         case CON_TASK_DISPLAY_TYPE_BITMAP:             // non-transparent raster image
  202.             szBtnHTML += "<DIV class=divSymbol id=divSymbol_" + theIndex + " style=\"LEFT: " + iLeftLoc + "%; TOP: " + iTopLoc + "%\">\n";
  203.             szBtnHTML += "<TABLE id=tblSymbol_" + theIndex + " border=0 cellPadding=0 cellSpacing=0 frame=none rules=none width=100%>\n";
  204.             szBtnHTML += "<TBODY>\n";
  205.             szBtnHTML += "<TR>\n";
  206.             szBtnHTML += "<TD align=middle class=tdSymbol id=tdSymbol_" + theIndex + " noWrap vAlign=top>";
  207.             szBtnHTML += StartHREFIfNecessary (theIndex, true);
  208.             szBtnHTML += "<IMG class=clsTaskBtn height=250 id=imgTaskBtn_" + theIndex + " src=\"\" ";
  209.             szBtnHTML += "style=\"HEIGHT: 66px; WIDTH: 66px\" width=250 border=0 TaskpadButton>";
  210.             szBtnHTML += EndHREFIfNecessary (theIndex, true);
  211.             szBtnHTML += "</TD></TR>\n";
  212.             szBtnHTML += "<TR>\n";
  213.             szBtnHTML += "<TD align=middle class=tdSymbol id=tdSymbol_" + theIndex + " vAlign=top width=100%>";
  214.             szBtnHTML += "<A class=clsSymbolBtn href=\"";
  215.             szBtnHTML += StartHREFIfNecessary (theIndex, false);
  216.             szBtnHTML += "\" id=anchorCaption_" + theIndex + " ";
  217.             szBtnHTML += "style=\"FONT-SIZE: 18px\" TaskpadButton>";
  218.             szBtnHTML += "<!--Insert Here--></A></TD></TR></TBODY></TABLE></DIV><!--divSymbol_" + theIndex + "-->\n";            
  219.  
  220.             break;
  221.     }    
  222.     return szBtnHTML;
  223. }
  224.  
  225. //*********************************
  226. // COMMON BUTTON BUILDING FUNCTIONS
  227. //*********************************
  228.  
  229. function InsertButtonBitmaps()
  230. {
  231.     for (var i = 0; i <= giTotalButtons; i++) {
  232.         switch (gaiBtnObjectType[i])
  233.         {
  234.             case CON_TASK_DISPLAY_TYPE_VANILLA_GIF:        // (GIF) index 0 is transparent
  235.             case CON_TASK_DISPLAY_TYPE_CHOCOLATE_GIF:      // (GIF) index 1 is transparent
  236.             case CON_TASK_DISPLAY_TYPE_BITMAP:             // non-transparent raster image
  237.                 document.all("imgTaskBtn_" + i).src = gaszBtnOffBitmap[i];
  238.                 break;
  239.         }
  240.     }
  241. }
  242.  
  243. function InsertFontFamilyAndString()
  244. {
  245.     for (var i = 0; i <= giTotalButtons; i++) {
  246.         if (typeof(gaszFontFamilyName[i]) == "string") {
  247.             document.all("spanSymbol_" + i).style.fontFamily = gaszFontFamilyName[i];
  248.             document.all("spanSymbol_" + i).innerHTML = gaszSymbolString[i];
  249.         }
  250.     }
  251. }
  252.  
  253. function InsertCaptionText()
  254. {
  255.     // Insert caption text for each taskpad button
  256.     for (var i = 0; i <= giTotalButtons; i++) {
  257.         document.all("anchorCaption_" + i).innerHTML = gaszBtnCaptions[i];
  258.     }
  259. }
  260.  
  261. function EnableGrayscaleFilter()
  262. {
  263.     for (var i = 0; i <= giTotalButtons; i++) {
  264.         // Grayscale filter only applies to raster-based images
  265.         if (gaiBtnObjectType[i] == CON_TASK_DISPLAY_TYPE_BITMAP) {
  266.             // Grayscale filter only applies if gaszBtnOverBitmap[i] is undefined
  267.             if (typeof(gaszBtnOverBitmap[i]) == "undefined") {
  268.                 document.all("imgTaskBtn_" + i).style.filter = "gray";
  269.             }
  270.         }
  271.     }
  272. }
  273.  
  274. function InsertTaskpadText()
  275. {
  276.     // Insert text for taskpad title, description, watermark, and branding
  277.     // This custom taskpad assumes that both the watermark & branding are symbol-based
  278.     
  279.     // Use insertAdjacentText("AfterBegin") for divTitle so that we
  280.     // don't blow out the contained divAbout element
  281.     divTitle.insertAdjacentText("AfterBegin", gszTaskpadTitle);
  282.  
  283.     // Use innerHTML for elements below to support formatting (e.g. <br>)
  284.     divDescription.innerHTML = gszTaskpadDescription;
  285.     
  286.     // Use innerHTML to render Unicode watermark & branding characters
  287.     tdWatermark.innerHTML = gszWatermarkSymbolString;
  288.     tdBranding.innerHTML = gszBrandingSymbolString;    
  289. }
  290.  
  291. function SetupListview()
  292. {
  293.     if (gbShowLVTitle == true) {        
  294.         // if gbShowLVTitle is true, add strings to listview
  295.         tdLVTitle.innerText = gszLVTitle;
  296.  
  297.         // Determine if author really wants to show the listview button
  298.         if (gbHasLVButton == true) {        
  299.             anchorLVButton_0.innerText = gszLVBtnCaption;
  300.         }
  301.         // If not, hide it
  302.         else {
  303.             divLVButton_0.style.visibility = "hidden";
  304.         }
  305.     }
  306.     else {
  307.         // gbShowLVTitle is false, so nothing has been specified for a listview header or button;
  308.         // hide these elements and let the listview occupy 100% of its parent"s height
  309.         divLVTitle.style.visibility= "hidden";
  310.         divLV.style.top = "0%";
  311.         divLV.style.height = "100%";
  312.     }
  313. }
  314.  
  315. //***************************************
  316. // BUTTON HIGHLIGHT/UNHIGHLIGHT FUNCTIONS
  317. //***************************************
  318.  
  319. function HighlightButton(szBtnIndex)
  320. {
  321.   // Determine button type
  322.   switch (gaiBtnObjectType[szBtnIndex])
  323.   {
  324.     case 1:     // Symbol
  325.             document.all("spanSymbol_" + szBtnIndex).style.color = "threeddarkshadow";
  326.       break;
  327.  
  328.     case 2:     // GIF Vanilla
  329.     case 3:     // GIF Chocolate
  330.             document.all("imgTaskBtn_" + szBtnIndex).filters.mask.color = SysColorX.RGBthreeddarkshadow;
  331.       break;
  332.  
  333.     case 4:     // Raster
  334.       if (typeof(gaszBtnOverBitmap[szBtnIndex]) == "string") {
  335.             // Use SRC swapping if an "OverBitmap" is specified
  336.           document.all("imgTaskBtn_" + szBtnIndex).src = gaszBtnOverBitmap[szBtnIndex];
  337.         }
  338.         else {
  339.             // Otherwise, toggle from grayscale to color for single bitmap
  340.           document.all("imgTaskBtn_" + szBtnIndex).filters[0].enabled = 0;
  341.         }
  342.         break;
  343.         
  344.     default:
  345.       alert ("Unrecognized image format for button index " + szBtnIndex);
  346.       break;        
  347.   }
  348.  
  349.     document.all("anchorCaption_" + szBtnIndex).style.color = "threeddarkshadow";
  350.     document.all("anchorCaption_" + szBtnIndex).style.textDecoration = "underline";
  351.  
  352.     // Keep track of tooltip index and display tooltip
  353.     giTooltipIndex = szBtnIndex;
  354.  
  355.     // Show the tooltip after latency period specified by giTooltipLatency
  356.     gTooltipTimer = window.setTimeout("TaskpadTooltipShow()", giTooltipLatency, "jscript");
  357. }
  358.  
  359.  
  360. function UnhighlightButton()
  361. {
  362.   if (typeof(gszLastBtn) != "undefined") {
  363.  
  364.     // Determine button type
  365.     switch (gaiBtnObjectType[gszLastBtn])
  366.     {
  367.       case 1:     // Symbol                
  368.                 document.all("spanSymbol_" + gszLastBtn).style.color = "threedshadow";
  369.         break;
  370.  
  371.       case 2:     // GIF Vanilla
  372.       case 3:     // GIF Chocolate
  373.                 document.all("imgTaskBtn_" + gszLastBtn).filters.mask.color = SysColorX.RGBthreedshadow;
  374.         break;
  375.  
  376.       case 4:     // Raster
  377.         if (typeof(gaszBtnOverBitmap[gszLastBtn]) == "string") {
  378.               // Use SRC swapping if an "OverBitmap" is specified
  379.             document.all("imgTaskBtn_" + gszLastBtn).src = gaszBtnOffBitmap[gszLastBtn];
  380.           }
  381.           else {
  382.               // Otherwise, toggle from color to grayscale for single bitmap
  383.             document.all("imgTaskBtn_" + gszLastBtn).filters[0].enabled = 1;
  384.           }
  385.           break;
  386.           
  387.       default:
  388.         alert("Unrecognized image format for index " + gszLastBtn);
  389.         break;        
  390.     }  
  391.  
  392.         document.all("anchorCaption_" + gszLastBtn).style.color = "threedshadow";
  393.         document.all("anchorCaption_" + gszLastBtn).style.textDecoration = "none";
  394.  
  395.         TaskpadTooltipHide();
  396.     }
  397. }
  398.  
  399. function IsStillOverButton()
  400. {
  401.     //  Purpose: Determines if a mouseover or mouseout event
  402.     //  was fired over the same button (indicating that the pointer
  403.     //  is still over the button and that highlighting/unhighlighting
  404.     //  should be ignored.
  405.     // 
  406.     //  Returns true if and only if:
  407.     //    * both fromElement and toElement are not null;
  408.     //    * both elements contain a user-defined "TaskpadButton" attribute;
  409.     //    * both element IDs match.
  410.     
  411.     var fromX = window.event.fromElement;
  412.     var toX = window.event.toElement;
  413.  
  414.     // Trap case where mouse pointer appeared over a button out of nowhere,
  415.     // (e.g. as a result of switching focus from another app).
  416.     if ((fromX != null) && (toX != null)) {
  417.         // return true if moving within elements of a single button
  418.         if ((fromX.getAttribute("TaskpadButton") != null) == (toX.getAttribute("TaskpadButton") != null)) {
  419.             if (GetElementIndex(fromX.id) == GetElementIndex(toX.id)) {
  420.                 return true;
  421.             }
  422.         }
  423.     }
  424.     return false;
  425. }
  426.  
  427. //*****************
  428. //TOOLTIP FUNCTIONS
  429. //*****************
  430.  
  431. function LoadTooltipPointer()
  432. {
  433.     divTooltipPointer.innerHTML = L_gszTooltipPointer_StaticText;
  434. }
  435.  
  436. function TaskpadTooltipShow()
  437. {
  438.     // Load in appropriate tooltip text from the module-level string array
  439.     tdTooltip.innerHTML = gaszBtnTooltips[giTooltipIndex];
  440.     
  441.     // Position the tooltip vertically
  442.   SetTooltipVertical();
  443.  
  444.     // Position the tooltip horizontally
  445.   SetTooltipHorizontal();
  446.   
  447.     // Show the tooltip & pointer
  448.     divTooltip.style.visibility = "visible";
  449.     divTooltipPointer.style.visibility = "visible";
  450. }
  451.  
  452. function SetTooltipVertical()
  453. {
  454.     // Get offset and scroll values for containing div and symbol
  455.     var divScrollTop = divSymbolContainer.scrollTop;
  456.     var divOffsetHeight = divSymbolContainer.offsetHeight
  457.     var elOffsetTop = document.all("divSymbol_" + gszLastBtn).offsetTop;
  458.  
  459.     // Calculate the relative position of the top of the
  460.     // selected button within the divSymbolContainer
  461.     var iBtnLoc = Math.floor(((elOffsetTop - divScrollTop) / divOffsetHeight) * 100);
  462.             
  463.     // If the button location is <= 52
  464.     if (iBtnLoc <= 52) {
  465.         // Position the tooltip below the button
  466.         SetTooltipVerticalBelow();
  467.     }
  468.     else {
  469.         // Otherwise, position the tooltip above the button
  470.         SetTooltipVerticalAbove();
  471.     }
  472. }
  473.  
  474. function SetTooltipVerticalAbove()
  475. {
  476.     var iYLoc = document.all("divSymbol_" + giTooltipIndex).offsetTop;
  477.     iYLoc += divSymbolContainer.offsetTop;
  478.     iYLoc -= tblTooltip.offsetHeight;
  479.     
  480.     // Subtract scrollTop to account for container div scrolling
  481.     iYLoc -= divSymbolContainer.scrollTop;
  482.     
  483.     // Offset the tooltip by an additional fixed-constant size of the symbol fontSize
  484.     switch (gaiBtnObjectType[giTooltipIndex])
  485.     {
  486.         // Offset the top by an additional fixed-constant size
  487.         case 1:     // Symbol
  488.             iYLoc -= (GetPixelSize(document.all("spanSymbol_" + giTooltipIndex).style.fontSize) * L_ConstTooltipOffsetBottom_Number);
  489.             break;
  490.  
  491.         case 2:     // GIF Vanilla
  492.         case 3:     // GIF Chocolate
  493.         case 4:     // Raster
  494.             iYLoc -= ((document.all("imgTaskBtn_" + giTooltipIndex).offsetHeight) * L_ConstTooltipOffsetBottom_Number);
  495.             break;
  496.               
  497.         default:
  498.             // Stub
  499.             break;
  500.     }    
  501.  
  502.     // Position the tooltip vertically
  503.     divTooltip.style.pixelTop = iYLoc;
  504.     
  505.     // Position the tooltip pointer vertically
  506.     divTooltipPointer.style.pixelTop = iYLoc + tblTooltip.offsetHeight - (GetPixelSize(divTooltipPointer.style.fontSize) / L_ConstTooltipPointerOffsetBottom_Number);
  507. }
  508.  
  509. function SetTooltipVerticalBelow()
  510. {
  511.     var iYLoc = document.all("divSymbol_" + giTooltipIndex).offsetTop;
  512.     iYLoc += document.all("tblSymbol_" + giTooltipIndex).offsetHeight;
  513.     iYLoc += divSymbolContainer.offsetTop;
  514.     
  515.     // Subtract scrollTop to account for container div scrolling
  516.     iYLoc -= divSymbolContainer.scrollTop;
  517.     
  518.     // Offset the tooltip by an additional fixed-constant size of the symbol fontSize
  519.     switch (gaiBtnObjectType[giTooltipIndex])
  520.     {
  521.         // Offset the top by an additional fixed-constant size
  522.         case 1:     // Symbol
  523.             iYLoc += (GetPixelSize(document.all("spanSymbol_" + giTooltipIndex).style.fontSize) * L_ConstTooltipOffsetBottom_Number);
  524.             break;
  525.  
  526.         case 2:     // GIF Vanilla
  527.         case 3:     // GIF Chocolate
  528.         case 4:     // Raster
  529.             iYLoc += ((document.all("imgTaskBtn_" + giTooltipIndex).offsetHeight) * L_ConstTooltipOffsetBottom_Number);
  530.             break;
  531.               
  532.         default:
  533.             // Stub
  534.             break;
  535.     }    
  536.  
  537.     // Position the tooltip vertically
  538.     divTooltip.style.pixelTop = iYLoc;
  539.     
  540.     // Position the tooltip pointer vertically
  541.     divTooltipPointer.style.pixelTop = iYLoc - (GetPixelSize(divTooltipPointer.style.fontSize) / L_ConstTooltipPointerOffsetTop_Number);
  542. }
  543.  
  544. function SetTooltipHorizontal()
  545. {
  546.     var iSymbolLeft = document.all("divSymbol_" + giTooltipIndex).offsetLeft;
  547.     var iSymbolWidth = document.all("divSymbol_" + giTooltipIndex).offsetWidth;
  548.     var iTooltipWidth = document.all("divTooltip").offsetWidth;
  549.  
  550.     // Center the tooltip horizontally w/ respect to its symbol
  551.     var iXLoc;
  552.     if (iSymbolWidth >= iTooltipWidth) {
  553.         // Symbol is wider than tooltip
  554.         iXLoc = ( (iSymbolWidth - iTooltipWidth) / 2) + iSymbolLeft;
  555.     }
  556.     else {
  557.         // Tooltip is wider than symbol
  558.         iXLoc = ( (iTooltipWidth - iSymbolWidth) / 2) + iSymbolLeft;
  559.     }
  560.  
  561.     iXLoc += divSymbolContainer.style.pixelLeft;
  562.  
  563.     // Position the tooltip horizontally
  564.     divTooltip.style.left = iXLoc;
  565.     
  566.     // Position the tooltip pointer horizontally
  567.     divTooltipPointer.style.pixelLeft = iXLoc + (iTooltipWidth / 2) - ( GetPixelSize(divTooltipPointer.style.fontSize) / 2 );
  568. }
  569.  
  570. function TaskpadTooltipHide()
  571. {
  572.     divTooltip.style.visibility = "hidden";
  573.     divTooltipPointer.style.visibility = "hidden";
  574.     window.clearTimeout(gTooltipTimer);
  575.     // Empty the innerHTML, which causes the height to collapse
  576.     tdTooltip.innerHTML = "";
  577. }
  578.  
  579. //****************
  580. // RESIZE FUNCTION
  581. //****************
  582.  
  583. function ResizeTaskpadElements(iTaskpadStyle)
  584. {
  585.   var iSmallerDimension = GetSmallerDimension();
  586.     
  587.     // Bail out if iSmallerDimension < 1
  588.     if (iSmallerDimension <= 0) {
  589.         return;
  590.     }
  591.   
  592.     // Title & description
  593.     divTitle.style.fontSize = iSmallerDimension * L_ConstTitleText_Number;
  594.     divDescription.style.fontSize = iSmallerDimension * L_ConstDescriptionText_Number;
  595.  
  596.     // Watermark
  597.     // TODO: Resizing support only implemented for symbol-based watermark
  598.  
  599.     switch (iTaskpadStyle)
  600.     {        
  601.         case CON_TASKPAD_STYLE_VERTICAL1:
  602.             tdWatermark.style.fontSize = iSmallerDimension * L_ConstWatermarkVerticalText_Number;
  603.             break;
  604.             
  605.         case CON_TASKPAD_STYLE_HORIZONTAL1:
  606.             tdWatermark.style.fontSize = iSmallerDimension * L_ConstWatermarkHorizontalText_Number;
  607.             break;
  608.             
  609.         case CON_TASKPAD_STYLE_NOLISTVIEW:
  610.             tdWatermark.style.fontSize = iSmallerDimension * L_ConstWatermarkNoListviewText_Number;
  611.             break;
  612.     }
  613.  
  614.     // Tooltips
  615.     tblTooltip.style.fontSize = iSmallerDimension * L_ConstTooltipText_Number;
  616.     divTooltipPointer.style.fontSize = iSmallerDimension * L_ConstTooltipPointerText_Number;    
  617.  
  618.     // Listview elements
  619.     if (iTaskpadStyle != CON_TASKPAD_STYLE_NOLISTVIEW) {
  620.         tdLVButton_0.style.fontSize = iSmallerDimension * L_ConstLVButtonText_Number;
  621.         tdLVTitle.style.fontSize = iSmallerDimension * L_ConstLVTitleText_Number;
  622.     }
  623.   
  624.   // Apply multipliers to symbol text
  625.   for (var i = 0; i <= giTotalButtons; i++) {
  626.   
  627.     // All buttons have an anchor caption
  628.     document.all("anchorCaption_" + i).style.fontSize = iSmallerDimension * L_ConstSpanAnchorText_Number;
  629.   
  630.     // Determine button type (either symbol- or image-based)
  631.     switch (gaiBtnObjectType[i])
  632.     {
  633.       case 1:     // Symbol
  634.         document.all("spanSymbol_" + i).style.fontSize = iSmallerDimension * L_ConstSpanSymbolText_Number;
  635.         break;
  636.         
  637.       case 2:     // GIF Vanilla
  638.       case 3:     // GIF Chocolate
  639.       case 4:     // Raster
  640.         document.all("imgTaskBtn_" + i).style.width = iSmallerDimension * L_ConstTaskButtonBitmapSize_Number;
  641.         document.all("imgTaskBtn_" + i).style.height = iSmallerDimension * L_ConstTaskButtonBitmapSize_Number;
  642.         break;
  643.         
  644.       default:
  645.         alert("Unrecognized image format for index " + i);        
  646.     }
  647.   }
  648. }
  649.  
  650. //******************
  651. // UTILITY FUNCTIONS
  652. //******************
  653.  
  654. function SynchColorsToSystem(iType)
  655. {
  656.     // Use CSS system constants
  657.     divTitle.style.color = "threeddarkshadow";
  658.     divTitle.style.borderColor = "threeddarkshadow";
  659.  
  660.     divDescription.style.color = "threeddarkshadow";
  661.             
  662.     tblTooltip.style.backgroundColor = "infobackground";
  663.     tblTooltip.style.color = "infotext";
  664.     divTooltipPointer.style.color = "windowframe";
  665.     
  666.     // Special case the taskpad type
  667.     switch (iType) {
  668.         case CON_TASKPAD_STYLE_VERTICAL1:
  669.         case CON_TASKPAD_STYLE_HORIZONTAL1:
  670.             divLVContainerTop.style.backgroundColor = "buttonface";
  671.             divLVButton_0.style.backgroundColor = "threedshadow";
  672.             break;
  673.             
  674.         case CON_TASKPAD_STYLE_NOLISTVIEW:
  675.             // Stub
  676.             break;
  677.     }
  678. }
  679.